#ifndef __UNUBINIZE_H__
#define __UNUBINIZE_H__

#include "defs.h"

struct leb_list {
	uint32_t leb_num;
	uint32_t data_offset;
	uint32_t data_size;
	struct leb_list *last;
	struct leb_list *next;
};

struct volume_info_node {
	uint32_t vol_id;
	uint8_t vol_type;
	uint32_t alignment;
	uint32_t reserved_pebs;
	/* the data size written to the out_image is based on leb size; */
	uint32_t leb_count;
	uint32_t data_pad;
	char *name;
	uint32_t name_len;
	char *image_path;
	uint8_t upd_marker;
	uint8_t flags;
	struct leb_list *leb_list_head;
	struct volume_info_node *next;
};

void free_vi_list(struct volume_info_node *vi_list_head);

int unubinize(char *ubi_image_file, struct volume_info_node *vi_list_head);

#endif